﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="ReviewList.aspx.vb" Inherits="LondonItalianRestaurants.rest_review_list" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        Please comment on the restaurant below<br />
        <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="ID" DataSourceID="DetailsDataSource2" BorderColor="#666666" 
            BorderStyle="Solid" CssClass="table" Width="100%" GridLines="None">
            <Columns>
                <asp:BoundField DataField="RestaurantName" HeaderText="RestaurantName" 
                    SortExpression="RestaurantName" ControlStyle-BorderStyle="Solid" >
<ControlStyle BorderStyle="Solid"></ControlStyle>
                </asp:BoundField>
                <asp:TemplateField HeaderText="MichelinStars" SortExpression="MichelinStars">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("MichelinStars") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                    <b> 

                        <asp:Label ID="Label1" runat="server" ForeColor="blue" Font-Size="X-Large"  Text='<%# ShowStars(Eval("MichelinStars")) %>'></asp:Label></b>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:ImageField DataImageUrlField="RestaurantPicture" HeaderText="Thumbnail" 
                    SortExpression="Thumbnail" ControlStyle-CssClass="headerText">
                    <ControlStyle CssClass="DetailPicture" />
                </asp:ImageField>
                <asp:HyperLinkField DataNavigateUrlFields="PostCode" 
                    DataNavigateUrlFormatString="http://google.co.uk/maps?q={0}" 
                    DataTextField="PostCode" HeaderText="Map" SortExpression="Map" />
                <asp:HyperLinkField DataNavigateUrlFields="Website" 
                    DataNavigateUrlFormatString="{0}" DataTextField="Website" 
                    HeaderText="Website" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="DetailsDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT [ID], [RestaurantName], [RestaurantAddress], [PostCode], [PhoneNumber], [Website], [Restaurantmenu], [AveragePrice], [RestaurantPicture], [MichelinStars] FROM [Restaurants] WHERE ([ID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
    <div style="float:right"width="10em"; class="th"><asp:Rating ID="Rating2" runat="server" EmptyStarCssClass="empty" FilledStarCssClass="blue" StarCssClass="blue" WaitingStarCssClass="waitingblue">
    </asp:Rating>
    <br />
    <asp:Button ID="btn_rating" runat="server" Text="Submit Rating" />
   
        <br />
   
    <p>
        <asp:Button ID="btn_like" runat="server" Height="26px" Text="Like" 
            Width="54px" />
        <asp:Image ID="img_like" runat="server" Height="61px" 
            ImageUrl="~/Pictures/like1.png" Width="71px" />
        <asp:Button ID="btn_unlike" runat="server" Text="Unlike" />
        <asp:Image ID="img_unlike" runat="server" Height="60px" 
            ImageUrl="~/Pictures/unlike.png" Width="71px" /></div>
    <p>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT [Author], [Title], [CommentBody], [Restaurant_fkid] FROM [Comments] WHERE ([Restaurant_fkid]  = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
    <p>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Title:&nbsp;</p>
    
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="tb_Title" runat="server" Width="541px" CssClass="table"></asp:TextBox>
    <p>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        Comments:</p>
    
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="tb_CommentBody" runat="server" Height="205px" 
            TextMode="MultiLine" Width="547px" CssClass="table"></asp:TextBox>
    <p>
        <asp:Button ID="btn_Comment" runat="server" Text="Add Comment" Width="120px" />
    </p>
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </asp:ToolkitScriptManager>
        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
            DataSourceID="SqlDataSource1" CssClass="table" Width="100%">
            <Columns>
                <asp:BoundField DataField="Author" HeaderText="Author" 
                    SortExpression="Author" />
                <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
                <asp:BoundField DataField="CommentBody" HeaderText="CommentBody" 
                    SortExpression="CommentBody" />
            </Columns>
        </asp:GridView>
    <p>
    </p>
    
    <br />
    <br />
</asp:Content>
